<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ page import="java.io.*, java.sql.*, java.util.*,LS.*, date.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html>
<html lang="UTF-8">
<style>
/* 
.selectTableItem:hover {
	background-color: black;
	color: white;
	cursor: pointer;
}
 */
th,td {
	padding-bottom: 5px;
	padding-top: 5px;
}

h4,h1 {
	margin: 0px;
	padding: 0px;
}

th {
	height: 30px;
	border-right: 1px solid #e5e5e5;
	border-bottom: 1px solid #e5e5e5;
}

tr {
	border-bottom: 1px solid #e5e5e5;
}

table {
	width: 100%;
}

.category {
	width: 19.666666666666666666%;
}

.modelname {
	width: 19.666666666666666666%;
}

.no {
	width: 19.666666666666666666%;
}

.lendingdate {
	width: 15.5%;
}

.returndate {
	width: 15.5%;
}

.state {
	width: 10%;
}

#outerview {
	padding-top: 10px;
	margin-left: 0px;
	text-align: center;
	background-color: #fff;
	border: 1px solid #e5e5e5;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
	-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

#outerview {
	width: 100%;
	min-height: 600px;
	padding: 0px;
}

#middleview {
	width: 90%;
	height: 500px;
	margin: 20px auto 0px auto;
	left: 50%;
}

#innerview {
	width: 100%;
	height: 100%;
	text-align: center;
	background-color: #fff;
	border: 1px solid #e5e5e5;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
	-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
</style>

<head>
<meta charset="utf-8">
<title>성공회대학교 기자재 대여 시스템</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- styles시트 -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="assets/css/docs.css" rel="stylesheet">

<script type="text/javascript"
	src="http://code.jquery.com/jquery-1.7.min.js"></script>
<script type="text/javascript" src="assets/smartPop/jquery.smartPop.js"></script>
<link rel="stylesheet" href=".assets/smartPop/jquery.smartPop.css" />

<script type="text/javascript">
/* 
	$(document).ready(init);

	function init() {
		tableRowClickEvent();
	}

	function tableRowClickEvent() {
		$('tr.selectTableItem').click(SPOpen);
	} */
	
	
 /* 
 	function SPOpen() {
		$.smartPop.open({
			width : 900,
			height : 645,
			url : 'LSmartPop.do?model_name=' + $('#mName', this).text()
					+ "&item_name=" + $('#iName', this).text()
					+ "&lending_start_date=" + $('#sDate', this).text()
		});
	}
	  */
	function SPOpen(uId) {
		$.smartPop.open({
			width : 900,
			height : 645,
			url : 'studentSearchSmartPop.do?user_id=' + uId
		});
	}  

	function smartPopClose() {
		$.smartPop.close();
	}
</script>

</head>

<body data-spy="scroll" data-target=".bs-docs-sidebar">
	<!-- 메뉴
    ================================================== -->
	<%
		if (session.getAttribute("user") == null) {
	%>
	<jsp:include page="/top.do"></jsp:include>
	<%
		} else {
			Users u = (Users) session.getAttribute("user");
			if (u.getUser_position().equalsIgnoreCase("S")) {
	%>
	<!-- 학생이 로그인 했을 경우 메뉴 -->
	<jsp:include page="/studenttop.do"></jsp:include>
	<%
		} else if (u.getUser_position().equalsIgnoreCase("P")) {
	%>
	<!-- 교수가 로그인 했을 경우 메뉴 -->
	<jsp:include page="/teachertop.do"></jsp:include>
	<%
		} else {
	%>
	<!-- 관리자가 로그인 했을 경우 메뉴 -->
	<jsp:include page="/managertop.do"></jsp:include>
	<%
		}
		}
	%>

	<!-- 게시판
    ================================================== -->
	
	<div style="text-align: center">
		<div class="marketing"
			style="margin-bottom: 30px; color: #000; text-align: left">
			<div class="container">
				<h3 style="margin: 10px; font-size: 35px;">
					<strong>학생 및 교수 정보 검색</strong>
				</h3>
			</div>
		</div>
	</div>
	<div class="container">
		<div id="outerview">
			<div id="middleview">
				<div id="plusview">
					<div class="control-gruop">
						<form action="studentSearch.do" class="form-inline" style="text-align: left;">
							<div class="controls">
								<select name="dept" id="departmentname" style="width: 200px;">
									<option>학과</option>
									<option>소프트웨어공학</option>
									<option>멀티미디어시스템공학</option>
									<option>글로벌IT공학</option>
									<option>디지털컨텐츠미디어공학</option>
									<option>정보통신공학</option>
								</select> &nbsp;&nbsp; <select name="posi" id="itemname" style="width: 200px;">
									<option>직급</option>
									<option>학과장</option>
									<option>재직교수</option>
									<option>학생</option>
								</select> &nbsp;&nbsp; <br>
								<br> <select name="idOrName" id="searchselect" style="width: 100px;">
									<option>학번(사번)</option>
									<option>이름</option>
								</select> <input name="idOrNameText" type="text" class="input-middle" size=20>
								
								<button type="submit" class="btn">검색</button>
								
								&nbsp;&nbsp;&nbsp;
								
								<input type="checkbox" name="penaltyCheck" value="1">
								<b>&nbsp;페널티 존재하는 학생 및 교수만 검색</b>
								
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<!-- 
								<input type="checkbox" class="lendingCheck">
								<b>&nbsp;기자재 대여 중인 학생 및 교수만 검색</b>
								 -->
							</div>
						</form>
					</div>
				</div>
				<div id="innerview">
					<table class="tableview">
						<tr>
							<th>직급</th>
							<th>학번(사번)</th>
							<th>이름</th>
							<th>소속학과</th>
							<th style="width: 15%">현재 대여상태</div></th>
							<th style="width: 10%">패널티 존재</th>
							<!-- <th style="width: 10%">시간표보기</th> -->
						</tr>
						
						<c:forEach var="s" items="${searchUser}">
							<tr class="selectTableItem" id=sample2>
								<td>${s.user_position}</td>
								<td>${s.user_id}</td>
								<td>${s.name}</td>
								<td>${s.departments_name}</td>
								<td style="width: 15%"><input onclick="SPOpen(${s.user_id})" type="button" value="현재 대여상태"></td>
								<td style="width: 10%">${s.penalty}</td>
								<!-- <td style="width: 10%">시간표보기</td> -->
							</tr>
						</c:forEach>
						
					</table>
				</div>
			</div>
		</div>
	</div>
	

	<!-- 게시판 끝
	=========================================================== -->





	<!-- 꼬리말
    ================================================== -->
	<footer class="footer">
		<div class="container">
			<p>Copyright SKHU. Software Student.</p>
		</div>
	</footer>


	<!-- javascript -->
	<!-- 	<script src="../assets/js/jquery.js"></script> -->
</body>
</html>
